package com.bd.scm.module.rule.controller;


import com.alibaba.fastjson.JSONArray;
import com.bd.scm.module.common.BaseController;
import com.bd.scm.module.rule.service.IKtMjRuleService;
import com.bd.scm.module.rule.service.IMjRuleRealService;
import com.bd.scm.module.utils.ResultUtil;
import com.bd.utils.vo.Result;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *  考勤门禁规则前端控制器
 *  User: Yufc
 *  Date: 2019.12.21 13:44
 */
@RestController
@RequestMapping("/api/rule/kt")
public class KtMjRuleController extends BaseController {

    @Autowired
    private IKtMjRuleService ktMjRuleService;


    /**
     * 根据ID获取规则
     * @param id
     * @return
     */
    @GetMapping
    public Result getById(@RequestParam("id") int id){
        return ResultUtil.ok(ktMjRuleService.getById(id));
    }

    @GetMapping("num")
    public Result getByNumber(@RequestParam("number") String number){
        return ResultUtil.ok(ktMjRuleService.getByNumber(number));
    }
}
